/**
 * Copyright &copy; 2012-2016 All rights reserved.
 */
package ${basepackage}.app.vo.query;

<#list table.queryImportList as i>
import ${i};
</#list>
<#if table.containsDateField>
import ${importbasepackage}.util.DateUtil;
</#if>
import ${importbasepackage}.framework.annotation.ColumnQuery;
import ${importbasepackage}.framework.base.page.BaseQuery;
import ${importbasepackage}.framework.annotation.Operator;

/**
 *@auther XiWei
 */

public class ${ClassName}Query extends BaseQuery{

	private static final long serialVersionUID = 1L;
	
	<#-- 生成字段属性 -->
	<#list table.searchColumnList as c>
	<#if c.queryField && !c.fk>
	<#if c.dateField>
	@DateTimeFormat(pattern="dd/MM/yyyy")	
	private Date ${c.javaField}Begin;
	@DateTimeFormat(pattern="dd/MM/yyyy")	
	private Date ${c.javaField}End;	
	<#else>
	private ${c.simpleJavaType} ${c.javaField}; <#if c.columnComment??>//${c.columnComment} </#if>	
	</#if>
	</#if>
	</#list>
	
	<#list table.importedKeyList as c>
	private ${c.referencedColumnType} ${c.columnNameJavaField}Id;<#if c.column.columnComment??>//${c.column.columnComment} </#if>
	</#list>
	
	
	<#-- 生成get/set方法 -->
	<#list table.searchColumnList as c>
	<#if c.queryField && !c.fk>
	<#if c.dateField>
	@ColumnQuery(name="${c.javaField}",operator=Operator.GREATERTHANEQUAL)
	public Date get${c.javaField?cap_first}Begin()
	{
		return ${c.javaField}Begin;
	}
	public void set${c.javaField?cap_first}Begin(Date ${c.javaField}Begin)
	{	
		this.${c.javaField}Begin = ${c.javaField}Begin;
	}
	@ColumnQuery(name="${c.javaField}",operator=Operator.LESSTHANEQUAL)	
	public Date get${c.javaField?cap_first}End()
	{
		return DateUtil.getEndOfTheDay(${c.javaField}End);
	}
	public void set${c.javaField?cap_first}End(Date ${c.javaField}End)
	{
		this.${c.javaField}End = ${c.javaField}End;
	}
	<#else>
	@ColumnQuery<#if c.queryType??>(operator=${c.queryType}) </#if>
	public ${c.simpleJavaType} get${c.javaField?cap_first}()
	{
		return ${c.javaField};
	}	

	public void set${c.javaField?cap_first}(${c.simpleJavaType} ${c.javaField})
	{
		this.${c.javaField} = ${c.javaField};
	}
	</#if>	
	</#if>
	</#list>
	
	<#--外键对应的查询 -->
	<#list table.importedKeyList as key>
	@ColumnQuery(name="${key.columnNameJavaField}.${key.referencedColumnName}")
	public ${key.referencedColumnType} get${key.columnNameJavaField?cap_first}Id()
	{
		return ${key.columnNameJavaField}Id;
	}

	public void set${key.columnNameJavaField?cap_first}Id(${key.referencedColumnType} ${key.columnNameJavaField}Id)
	{
		this.${key.columnNameJavaField}Id = ${key.columnNameJavaField}Id;
	}
	</#list>
	
}